(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

p(0) → 0
p(s(X)) → X
leq(0, Y) → true
leq(s(X), 0) → false
leq(s(X), s(Y)) → leq(X, Y)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
diff(X, Y) → if(leq(X, Y), n__0, n__s(n__diff(n__p(X), Y)))
0n__0
s(X) → n__s(X)
diff(X1, X2) → n__diff(X1, X2)
p(X) → n__p(X)
activate(n__0) → 0
activate(n__s(X)) → s(activate(X))
activate(n__diff(X1, X2)) → diff(activate(X1), activate(X2))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
p(z0) → n__p(z0)
leq(0, z0) → true
leq(s(z0), 0) → false
leq(s(z0), s(z1)) → leq(z0, z1)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
diff(z0, z1) → if(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1)))
diff(z0, z1) → n__diff(z0, z1)
0n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(activate(z0))
activate(n__diff(z0, z1)) → diff(activate(z0), activate(z1))
activate(n__p(z0)) → p(activate(z0))
activate(z0) → z0
Tuples:

P(0) → c(0')
P(s(z0)) → c1
P(z0) → c2
LEQ(0, z0) → c3
LEQ(s(z0), 0) → c4
LEQ(s(z0), s(z1)) → c5(LEQ(z0, z1))
IF(true, z0, z1) → c6(ACTIVATE(z0))
IF(false, z0, z1) → c7(ACTIVATE(z1))
DIFF(z0, z1) → c8(IF(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1))), LEQ(z0, z1))
DIFF(z0, z1) → c9
0'c10
S(z0) → c11
ACTIVATE(n__0) → c12(0')
ACTIVATE(n__s(z0)) → c13(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(DIFF(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(P(activate(z0)), ACTIVATE(z0))
ACTIVATE(z0) → c16
S tuples:

P(0) → c(0')
P(s(z0)) → c1
P(z0) → c2
LEQ(0, z0) → c3
LEQ(s(z0), 0) → c4
LEQ(s(z0), s(z1)) → c5(LEQ(z0, z1))
IF(true, z0, z1) → c6(ACTIVATE(z0))
IF(false, z0, z1) → c7(ACTIVATE(z1))
DIFF(z0, z1) → c8(IF(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1))), LEQ(z0, z1))
DIFF(z0, z1) → c9
0'c10
S(z0) → c11
ACTIVATE(n__0) → c12(0')
ACTIVATE(n__s(z0)) → c13(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(DIFF(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(P(activate(z0)), ACTIVATE(z0))
ACTIVATE(z0) → c16
K tuples:none
Defined Rule Symbols:

p, leq, if, diff, 0, s, activate

Defined Pair Symbols:

P, LEQ, IF, DIFF, 0', S, ACTIVATE

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16

(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)

Removed 2 leading nodes:

IF(true, z0, z1) → c6(ACTIVATE(z0))
IF(false, z0, z1) → c7(ACTIVATE(z1))
Removed 12 trailing nodes:

P(0) → c(0')
DIFF(z0, z1) → c9
P(z0) → c2
LEQ(s(z0), 0) → c4
LEQ(s(z0), s(z1)) → c5(LEQ(z0, z1))
P(s(z0)) → c1
ACTIVATE(n__0) → c12(0')
ACTIVATE(z0) → c16
LEQ(0, z0) → c3
S(z0) → c11
DIFF(z0, z1) → c8(IF(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1))), LEQ(z0, z1))
0'c10

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
p(z0) → n__p(z0)
leq(0, z0) → true
leq(s(z0), 0) → false
leq(s(z0), s(z1)) → leq(z0, z1)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
diff(z0, z1) → if(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1)))
diff(z0, z1) → n__diff(z0, z1)
0n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(activate(z0))
activate(n__diff(z0, z1)) → diff(activate(z0), activate(z1))
activate(n__p(z0)) → p(activate(z0))
activate(z0) → z0
Tuples:

ACTIVATE(n__s(z0)) → c13(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(DIFF(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(P(activate(z0)), ACTIVATE(z0))
S tuples:

ACTIVATE(n__s(z0)) → c13(S(activate(z0)), ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(DIFF(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(P(activate(z0)), ACTIVATE(z0))
K tuples:none
Defined Rule Symbols:

p, leq, if, diff, 0, s, activate

Defined Pair Symbols:

ACTIVATE

Compound Symbols:

c13, c14, c15

(5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)

Removed 3 trailing tuple parts

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → 0
p(s(z0)) → z0
p(z0) → n__p(z0)
leq(0, z0) → true
leq(s(z0), 0) → false
leq(s(z0), s(z1)) → leq(z0, z1)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
diff(z0, z1) → if(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1)))
diff(z0, z1) → n__diff(z0, z1)
0n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(activate(z0))
activate(n__diff(z0, z1)) → diff(activate(z0), activate(z1))
activate(n__p(z0)) → p(activate(z0))
activate(z0) → z0
Tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
S tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
K tuples:none
Defined Rule Symbols:

p, leq, if, diff, 0, s, activate

Defined Pair Symbols:

ACTIVATE

Compound Symbols:

c13, c14, c15

(7) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

p(0) → 0
p(s(z0)) → z0
p(z0) → n__p(z0)
leq(0, z0) → true
leq(s(z0), 0) → false
leq(s(z0), s(z1)) → leq(z0, z1)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
diff(z0, z1) → if(leq(z0, z1), n__0, n__s(n__diff(n__p(z0), z1)))
diff(z0, z1) → n__diff(z0, z1)
0n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(activate(z0))
activate(n__diff(z0, z1)) → diff(activate(z0), activate(z1))
activate(n__p(z0)) → p(activate(z0))
activate(z0) → z0

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
S tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
K tuples:none
Defined Rule Symbols:none

Defined Pair Symbols:

ACTIVATE

Compound Symbols:

c13, c14, c15

(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
We considered the (Usable) Rules:none
And the Tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(ACTIVATE(x1)) = x1   
POL(c13(x1)) = x1   
POL(c14(x1, x2)) = x1 + x2   
POL(c15(x1)) = x1   
POL(n__diff(x1, x2)) = [1] + x1 + x2   
POL(n__p(x1)) = [1] + x1   
POL(n__s(x1)) = [1] + x1   

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:none
Tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
S tuples:none
K tuples:

ACTIVATE(n__s(z0)) → c13(ACTIVATE(z0))
ACTIVATE(n__diff(z0, z1)) → c14(ACTIVATE(z0), ACTIVATE(z1))
ACTIVATE(n__p(z0)) → c15(ACTIVATE(z0))
Defined Rule Symbols:none

Defined Pair Symbols:

ACTIVATE

Compound Symbols:

c13, c14, c15

(11) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(12) BOUNDS(1, 1)